Portable electronic devices, such as mobile phones, typically include a miniaturized camera module that utilizes an image sensor to capture images. Image sensors may include a color filter that is configured to detect different wavelengths of light at different pixels of the image sensor. For example, a Bayer color filter may include red pixels (R), green pixels adjacent to the red pixels (Gr), blue pixels (B), and green pixels adjacent to the blue pixels (Gb). A lens flare may occur when stray rays of light from relatively flat incident angles (i.e., angles far from the optical axis of the camera) passes through multiple adjacent color filters before being detected, thereby producing an undesirable shift in the detected light color due to the combination of the adjacent filter colors by the stray light ray.
For example, a lens flare may occur when light from a source just outside the intended image frame (e.g., a lamp positioned at an angle towards the edge of a scene) enters the image sensor of a camera. Since the detected light signals from various pixel types of a color filter scheme are typically gained (i.e., magnified), the stray light corresponding to the lens flare also gets magnified in conventional image processing systems, thereby resulting in a purple blob, flare, glow, or haze near the edge of the image. These purple image artifacts are undesirable, however miniaturized cameras in mobile devices do not typically have enough physical space available for lens shades, thick bezels, or other external countermeasures.